#pragma once

#include <QWidget>
#include <QMouseEvent>
#include <QSlider>
#include <QEvent>

class WCSlider : public QSlider
{
	Q_OBJECT

public:
	WCSlider(QWidget *parent = nullptr);
	~WCSlider();

protected:
	void mousePressEvent(QMouseEvent *event);
	void mouseMoveEvent(QMouseEvent *event);
	void mouseReleaseEvent(QMouseEvent *event);
	void leaveEvent(QEvent *event);

private:
	bool m_isMoving;
	int m_value;
	bool m_mousePress;
	int m_lastEmitIndex = -1;

signals:
	void slideMove(int, int, QPoint);
	void slideRelease();
	void sliderReleasedAt(int);

public slots:
	//void setValue(int value);
};
